<template>
  <section class="jumbotron">
    <h3 class="jumbotron-heading">Search Github Users</h3>
    <div>
      <input type="text" placeholder="enter the name you search" v-model="keyword" />&nbsp;
      <button @click="handler">Search</button>
    </div>
  </section>
</template>

<script>
export default {
  name: 'Header',
  data(){
    return {
      keyword:''
    }
  },
  methods:{
    handler(){
      // 点击按钮发送请求，把收集用户输入的keyword发送给Main组件（$emit）
      this.$bus.$emit('getKeyword',this.keyword)
    }
  }
}
</script>

<style scoped>

</style>
